Skip to contentSkip to conversation

Change in openvpn[master]: Fix ssl unit tests on OpenSSL 1.0.2

Openvpn-devel In review plaisthos (Code Review) 2 participants 6 messages Jan 22, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1705927509000.I378081f391ad755d0a6fd5613de5c2a8bacc389a@...2715...

#1 lore raw

Attention is currently required from: flichtenheld.

Hello flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/503?usp=email

to review the following change.

Change subject: Fix ssl unit tests on OpenSSL 1.0.2
......................................................................

Fix ssl unit tests on OpenSSL 1.0.2

OpenSSL 1.1.1 will initialise itself using clever linker magic. For OpenSSL 1.0.2 we need to manually initialise the library. For other unit tests just doing the OpenSSL_add_all_algorithms is enough but this unit test needs a more complete initialisation.

Change-Id: I378081f391ad755d0a6fd5613de5c2a8bacc389a
---
M tests/unit_tests/openvpn/test_ssl.c

1 file changed, 2 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/03/503/1

tests/unit_tests/openvpn/test_ssl.c +2 -2
index fd2049f..d0c3df7 100644
@@ -127,13 +127,13 @@
     };
 
 #if defined(ENABLE_CRYPTO_OPENSSL)
-    OpenSSL_add_all_algorithms();
+    tls_init_lib();
 #endif
 
     int ret = cmocka_run_group_tests_name("crypto tests", tests, NULL, NULL);
 
 #if defined(ENABLE_CRYPTO_OPENSSL)
-    EVP_cleanup();
+    tls_free_lib();
 #endif
 
     return ret;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/503?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I378081f391ad755d0a6fd5613de5c2a8bacc389a
Gerrit-Change-Number: 503
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: plaisthos.

flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/503?usp=email )

Change subject: Fix ssl unit tests on OpenSSL 1.0.2
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/503?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I378081f391ad755d0a6fd5613de5c2a8bacc389a
Gerrit-Change-Number: 503
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Comment-Date: Mon, 22 Jan 2024 13:00:12 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#3 lore raw

PATCH 1/1 Fix ssl unit tests on OpenSSL 1.0.2

In reply to a message not in the archive

From: Arne Schwabe <[email protected]...>

OpenSSL 1.1.1 will initialise itself using clever linker magic. For OpenSSL 1.0.2 we need to manually initialise the library. For other unit tests just doing the OpenSSL_add_all_algorithms is enough but this unit test needs a more complete initialisation.

Change-Id I378081f391ad755d0a6fd5613de5c2a8bacc389a

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/503
This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <[email protected]...>

tests/unit_tests/openvpn/test_ssl.c +2 -2
index fd2049f..d0c3df7 100644
@@ -127,13 +127,13 @@
     };
 
 #if defined(ENABLE_CRYPTO_OPENSSL)
-    OpenSSL_add_all_algorithms();
+    tls_init_lib();
 #endif
 
     int ret = cmocka_run_group_tests_name("crypto tests", tests, NULL, NULL);
 
 #if defined(ENABLE_CRYPTO_OPENSSL)
-    EVP_cleanup();
+    tls_free_lib();
 #endif
 
     return ret;
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: Fix ssl unit tests on OpenSSL 1.0.2

Good catch, "obviously correct" :-)

Your patch has been applied to the master branch.

Not applied to 2.6 since these new tests are not in release/2.6 - so, but not present.

commit dc4fde8052639ffbc29ccc87130a0ce25f6dcd6c

Author: Arne Schwabe
Date:   Mon Jan 22 14:09:09 2024 +0100
     Fix ssl unit tests on OpenSSL 1.0.2

     Acked-by: Frank Lichtenheld <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg28112.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/503?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld

Change subject: Fix ssl unit tests on OpenSSL 1.0.2
......................................................................

Fix ssl unit tests on OpenSSL 1.0.2

OpenSSL 1.1.1 will initialise itself using clever linker magic. For OpenSSL 1.0.2 we need to manually initialise the library. For other unit tests just doing the OpenSSL_add_all_algorithms is enough but this unit test needs a more complete initialisation.

Change-Id I378081f391ad755d0a6fd5613de5c2a8bacc389a

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg28112.html

---
M tests/unit_tests/openvpn/test_ssl.c

1 file changed, 2 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/03/503/2

tests/unit_tests/openvpn/test_ssl.c +2 -2
index fd2049f..d0c3df7 100644
@@ -127,13 +127,13 @@
     };
 
 #if defined(ENABLE_CRYPTO_OPENSSL)
-    OpenSSL_add_all_algorithms();
+    tls_init_lib();
 #endif
 
     int ret = cmocka_run_group_tests_name("crypto tests", tests, NULL, NULL);
 
 #if defined(ENABLE_CRYPTO_OPENSSL)
-    EVP_cleanup();
+    tls_free_lib();
 #endif
 
     return ret;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/503?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I378081f391ad755d0a6fd5613de5c2a8bacc389a
Gerrit-Change-Number: 503
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/503?usp=email )

Change subject: Fix ssl unit tests on OpenSSL 1.0.2
......................................................................

Fix ssl unit tests on OpenSSL 1.0.2

OpenSSL 1.1.1 will initialise itself using clever linker magic. For OpenSSL 1.0.2 we need to manually initialise the library. For other unit tests just doing the OpenSSL_add_all_algorithms is enough but this unit test needs a more complete initialisation.

Change-Id I378081f391ad755d0a6fd5613de5c2a8bacc389a

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg28112.html

---
M tests/unit_tests/openvpn/test_ssl.c

1 file changed, 2 insertions(+), 2 deletions(-)
tests/unit_tests/openvpn/test_ssl.c +2 -2
index fd2049f..d0c3df7 100644
@@ -127,13 +127,13 @@
     };
 
 #if defined(ENABLE_CRYPTO_OPENSSL)
-    OpenSSL_add_all_algorithms();
+    tls_init_lib();
 #endif
 
     int ret = cmocka_run_group_tests_name("crypto tests", tests, NULL, NULL);
 
 #if defined(ENABLE_CRYPTO_OPENSSL)
-    EVP_cleanup();
+    tls_free_lib();
 #endif
 
     return ret;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/503?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I378081f391ad755d0a6fd5613de5c2a8bacc389a
Gerrit-Change-Number: 503
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged